<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>Basic Layout - jQuery EasyUI Demo</title>
	<link rel="stylesheet" type="text/css" href="../../css/base.css" />
	<link id="easyuiTheme" rel="stylesheet" type="text/css" href="../../easy-ui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../easy-ui/themes/icon.css">
	<script type="text/javascript" src="../../easy-ui/jquery.min.js"></script>
	<script type="text/javascript" src="../../easy-ui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../../js/base.js" ></script>
</head>


<body class="easyui-layout" data-options="fit:true" style="overflow:hidden;">

		
		<!-- 表单查询-->
		<div data-options="region:'south',border:false," style="height:40px;text-align:center;">

			 <table style="width:100%;margin-top:8px;" >
				<tr><td style="align:center;">
				<a href='javascript:void(-1);' onclick="baseFormSubmit();"; class="easyui-linkbutton" data-options="iconCls:'icon-ok'">确定</a>&nbsp;&nbsp;
				<a href='javascript:void(-1);' onclick="baseFormClearSearch();";  class="easyui-linkbutton" data-options="iconCls:'icon-back'">清空</a>
				</td></tr>
			</table>
		
		</div>
		
		
		<div data-options="region:'center',border:true,">
		
		<!-- the dataForm start  -->
		<form id="baseForm" method="post" name="baseForm" target="hiddenFrame" style="margin:0px;padding:0px;overflow:hidden;">
			
			<input  name="status"  id="status" type="hidden" ></input>
			<input  name="type"  id="type" type="hidden" ></input>
			
  			<table border="0" cellpadding="0" cellspacing="3" class="data-table">
			
			
				<!-- 表格的布局控制 -->
				<tr class="data-table-base-tr">
				<td  class="data-table-label" >
				</td>
				<td id="table_input_base" >
				</td>
				
				<td  class="data-table-right-margin"></td>
				</tr>
				<!-- 表格的布局控制 结束 -->
			
				
				<tr>
				<td  class="data-table-label" width="80px">
				
				店铺名称：<font color="#FF0000">&nbsp;&nbsp;</font>
				</td>
				 <td class="data-table-input">
				<input  name="shopName" id="shopName" class="textbox" style="width:96%;" type="text" ></input>
				</td>
				
				</tr>
				<tr>
				<td  class="data-table-label" width="80px">
				
				开始日期：<font color="#FF0000">&nbsp;&nbsp;</font>
				</td>
				 <td class="data-table-input">
				<input  name="minStartTime" id="minStartTime" style="width:44%;" class="easyui-datetimebox" data-options="formatter:myformatter,parser:myparser,required:true,novalidate:true" ></input>~
				<input  name="maxStartTime" id="maxStartTime" style="width:44%;" class="easyui-datetimebox" data-options="formatter:myformatter,parser:myparser,required:true,novalidate:true"></input>
				</td>
				
				</tr>
				
				<tr>
				<td  class="data-table-label" >
				
				结束日期：<font color="#FF0000">&nbsp;&nbsp;</font>
				</td>
				 <td>
				<input  name=minEndTime id="minEndTime" style="width:44%;" class="easyui-datetimebox" data-options="formatter:myformatter,parser:myparser,required:true,novalidate:true" ></input>~
				<input  name="maxEndTime" id="maxEndTime" style="width:44%;" class="easyui-datetimebox" data-options="formatter:myformatter,parser:myparser,required:true,novalidate:true"></input>
				</td>
				</tr>
				
				<tr>
				<td  class="data-table-label" >
				
				状态：<font color="#FF0000">&nbsp;&nbsp;</font>
				</td>
				 <td >
				
				<input class="easyui-combobox" id="searchStatus_combobox" name="searchStatus_combobox" data-options="valueField:'id',textField:'text',editable:false" style="width:100%;"/>
				</td>
				</tr>
				
				
             </table>

			</form>
			
			<!-- the dataForm end  -->
			
			
		</div>
	
	

	<script type="text/javascript">
	
		//查询界面只会初始化一次
		function initPage(){
			 
			 parent.window.focus();
			  
		}
		
		
		
		window.onload=function(){
			 
			 parent.window.focus();
			
			 $('#searchStatus_combobox').combobox({
				 data: [{id:'',text:'--请选择--'},{id:'1',text:'审核中'},{id:'2',text:'已发布'},{id:'3',text:'已撤销'},{id:'4',text:'已过期'},{id:'5',text:'审核不通过'},{id:'6',text:'系统下架'}],
			  		value:"",
			  		width:parseInt($("#table_input_base")[0].offsetWidth)+2,
			  		onSelect: function(record){
				  			document.getElementById("status").value=record.id;
				  			//document.getElementById("searchSexShow").value=record.text;
					}
				});
			// parent.showProgressing();
			// sendRequestAjax('../../user/initSearch.do?responseFunction=initSearch',initPageCallback);
			 
		}
	
		function baseFormSubmit(){
		
			var json = {}; 
			var values = $("#baseForm").serializeArray(); 
			for (index = 0; index < values.length; ++index)
			{
				json[values[index].name] = values[index].value;
			}
			
//			alert(JSON.stringify(json));
			
			parent.closeProgressing();
			executeWindowCallback(json);
			curWinClose();
			
			
			
		}
		
		
		
		function  baseFormClearSearch(){
			
			baseFormClear();
			initPageCallback(responseResultPage);
			baseFormSubmit();
			
		}
		
		
		
		document.onkeydown = function(evt){
	   		  var evt = window.event?window.event:evt;
	    		  if (evt.keyCode==13) {
	            baseFormSubmit();
	     }
    	}
	
		
		function myformatter(date){
			var y = date.getFullYear();
			var m = date.getMonth()+1;
			var d = date.getDate();

			/* var h = date.getHours();
			var mm = date.getMinutes();
			var s = date.getSeconds(); 
			/* return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d)+' '+(h<10?('0'+h):h)+':'+(mm<10?('0'+mm):mm)+':'+(s<10?('0'+s):s); */
			return y+'-'+(m<10?('0'+m):m)+'-'+(d<10?('0'+d):d);
		}
		function myparser(s){
			if (!s) 
				return new Date();
			var dm = s.split(' ')
			var ss = (dm[0].split('-'));
			var y = parseInt(ss[0],10);
			var m = parseInt(ss[1],10);
			var d = parseInt(ss[2],10);
			
			/* var hms = (dm[1].split(':'));
			var h =  parseInt(hms[0],10);
			var mm =  parseInt(hms[1],10);
			var s =  parseInt(hms[2],10); */
			if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
				/* return new Date(y,m-1,d,h,mm,s); */
				return new Date(y,m-1,d);
			}else{
				return new Date();
			}
		}
		
	</script>

	

</body>
</html>